def fib(n):
    a, b = 0, 1
    while a < n:
        # print(a, end=' ')
        a, b = b, a + b
        yield a
    # print()


# b = fib(100000000)
# print(b)
# for i in b:
#     print(i)


def three_sum(n):
    pass
    a, b, c = 0, 1, 2
    while a < n:
        a, b, c = b, c, a + b + c
        yield a

t = three_sum(100)
# print(three_sum(10))
for i in  t:
    print(i)